Export symbols needed by binder
authorBen Hutchings <ben@decadent.org.uk>
Tue, 8 Jul 2025 11:32:21 +0000 (13:32 +0200)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 12 Mar 2026 12:28:10 +0000 (13:28 +0100)
Bug-Debian: https://bugs.debian.org/901492

We want to enable use of the Android binder driver to support
Waydroid, but it should not be built-in as that would waste resources
and increase security attack surface on systems that don't need it.

Export the currently un-exported symbols it depends on.

Gbp-Pq: Topic debian
Gbp-Pq: Name export-symbols-needed-by-binder.patch

fs/file.c
ipc/msgutil.c
ipc/namespace.c
kernel/sched/syscalls.c
kernel/sched/wait.c
kernel/task_work.c
mm/list_lru.c
mm/memory.c
mm/mmap_lock.c
security/security.c

index 0a4f3bdb2dec6284a0c7b9687213137f2eecb250..1a53e54740850a45a9a8ce7063c35e9cd3024c8a 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -881,6 +881,7 @@ struct file *file_close_fd(unsigned int fd)
 
        return file;
 }
+EXPORT_SYMBOL_GPL(file_close_fd);
 
 void do_close_on_exec(struct files_struct *files)
 {
index e28f0cecb2ec942a4f6ee93df8384716bd026011..89a8fae5d90ce74d93cacedc08fe7db797eccd4d 100644 (file)
@@ -35,6 +35,7 @@ struct msg_msgseg {
        struct msg_msgseg *next;
        /* the next part of the message follows immediately */
 };
+EXPORT_SYMBOL_GPL(init_ipc_ns);
 
 #define DATALEN_MSG    ((size_t)PAGE_SIZE-sizeof(struct msg_msg))
 #define DATALEN_SEG    ((size_t)PAGE_SIZE-sizeof(struct msg_msgseg))
index 535f16ea40e187a9152a03a7345e00b6c5611dbe..47e7af1b1ec6aaa3a0d86ad2c70a85d1d05a4274 100644 (file)
@@ -210,6 +210,7 @@ void put_ipc_ns(struct ipc_namespace *ns)
                        schedule_work(&free_ipc_work);
        }
 }
+EXPORT_SYMBOL_GPL(put_ipc_ns);
 
 static struct ns_common *ipcns_get(struct task_struct *task)
 {
index 6f10db3646e7f6228e7847394c5ad45297e8c3db..14cb3de510ebd72dd126d95a86f2472b611ce7a8 100644 (file)
@@ -119,6 +119,7 @@ int can_nice(const struct task_struct *p, const int nice)
 {
        return is_nice_reduction(p, nice) || capable(CAP_SYS_NICE);
 }
+EXPORT_SYMBOL_GPL(can_nice);
 
 #ifdef __ARCH_WANT_SYS_NICE
 
index 20f27e2cf7aec691af040fcf2236a20374ec66bf..8b1338c283414e1dd14b65dca47dfc4021b9bedd 100644 (file)
@@ -231,6 +231,7 @@ void __wake_up_pollfree(struct wait_queue_head *wq_head)
        /* POLLFREE must have cleared the queue. */
        WARN_ON_ONCE(waitqueue_active(wq_head));
 }
+EXPORT_SYMBOL_GPL(__wake_up_pollfree);
 
 /*
  * Note: we use "set_current_state()" _after_ the wait-queue add,
index 0f7519f8e7c93f9a4536c26a341255799c320432..45fd146b85df4eb8bb14db22ccb84ad6d158317e 100644 (file)
@@ -102,6 +102,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,
 
        return 0;
 }
+EXPORT_SYMBOL_GPL(task_work_add);
 
 /**
  * task_work_cancel_match - cancel a pending work added by task_work_add()
index ec48b5dadf519a5296ac14cda035c067f9e448f8..bf95d73c9815548a19db6345f856cee9baad22e3 100644 (file)
@@ -179,6 +179,7 @@ bool list_lru_add(struct list_lru *lru, struct list_head *item, int nid,
        unlock_list_lru(l, false);
        return false;
 }
+EXPORT_SYMBOL_GPL(list_lru_add);
 
 bool list_lru_add_obj(struct list_lru *lru, struct list_head *item)
 {
@@ -216,6 +217,7 @@ bool list_lru_del(struct list_lru *lru, struct list_head *item, int nid,
        unlock_list_lru(l, false);
        return false;
 }
+EXPORT_SYMBOL_GPL(list_lru_del);
 
 bool list_lru_del_obj(struct list_lru *lru, struct list_head *item)
 {
index da360a6eb8a48e29293430d0c577fb4b6ec58099..345f21c374769c131db3ab3a5a1aabe3828fe7d7 100644 (file)
@@ -2168,6 +2168,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
        zap_page_range_single_batched(&tlb, vma, address, size, details);
        tlb_finish_mmu(&tlb);
 }
+EXPORT_SYMBOL_GPL(zap_page_range_single);
 
 /**
  * zap_vma_ptes - remove ptes mapping the vma
index 7421b7ea80012146e73b647df4c6a06ca16c0d44..850527b4462a61a31f0297ac4c13c9f18357e293 100644 (file)
@@ -380,6 +380,7 @@ fallback:
 
        return vma;
 }
+EXPORT_SYMBOL_GPL(lock_vma_under_rcu);
 #endif /* CONFIG_PER_VMA_LOCK */
 
 #ifdef CONFIG_LOCK_MM_AND_FIND_VMA
index 31a688650601b62df1e536bbe4407817edbd6707..b4776f0e25b33df95379a08a7659c0e5f767237b 100644 (file)
@@ -488,6 +488,7 @@ int security_binder_set_context_mgr(const struct cred *mgr)
 {
        return call_int_hook(binder_set_context_mgr, mgr);
 }
+EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);
 
 /**
  * security_binder_transaction() - Check if a binder transaction is allowed
@@ -503,6 +504,7 @@ int security_binder_transaction(const struct cred *from,
 {
        return call_int_hook(binder_transaction, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transaction);
 
 /**
  * security_binder_transfer_binder() - Check if a binder transfer is allowed
@@ -518,6 +520,7 @@ int security_binder_transfer_binder(const struct cred *from,
 {
        return call_int_hook(binder_transfer_binder, from, to);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_binder);
 
 /**
  * security_binder_transfer_file() - Check if a binder file xfer is allowed
@@ -534,6 +537,7 @@ int security_binder_transfer_file(const struct cred *from,
 {
        return call_int_hook(binder_transfer_file, from, to, file);
 }
+EXPORT_SYMBOL_GPL(security_binder_transfer_file);
 
 /**
  * security_ptrace_access_check() - Check if tracing is allowed